#ifndef execNow
#define execNow call compile preprocessfilelinenumbers
#endif

if (!isDedicated && hasInterface) then {
	execNow "tmf\support\modules\tao_foldmap\init.sqf";
	if (isNil "TYR_MENU_IsActive" || {TYR_MENU_IsActive <= 0}) then {
		
	} else {
		if (!isnil "tyr_fnc_addHandler") then {
			["TYRMENU",
				[[
					localize "STR_TAO_FM_ACTION"
					,{true}
					,{
						private ["_check"];
						if (isNil "tao_foldmap_open") then {tao_foldmap_open = false};
						// Don't show map outside of usual cameras, when dead, or when in debug
						_check = (cameraView in ["INTERNAL","EXTERNAL","GUNNER"]) && alive player && isNil "BIS_DEBUG_CAM";				
						if (_check && !tao_foldmap_open) then {
							tao_foldmap_open = true;
							[] spawn tao_foldmap_drawMapLoop;
						} else {
							tao_foldmap_open = false;
						};
					}
					,"tmf\support\modules\tao_foldmap\foldmap.paa"
				]]
			] call tyr_fnc_addHandler;
		};
	};
};

